package com.yswy.backstage.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.util.List;

/**
 * This is Description
 *
 * @author linlifu
 * @date 2020/01/07
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PermissionPARAM {

    @NotNull(message = "角色ID不能为空", groups = Appoint.class)
    private Integer roleId;

    @NotEmpty(message = "菜单列表Id不能为空", groups = {Appoint.class})
    //@ApiModelProperty("菜单列表Id不能为空")
    private List<Integer> permissionIdList;

    @ApiModelProperty("需要删除的权限ID list")
    private List<Integer> toDeletePermissionIdList;

    @NotBlank(message = "菜单ID不能为空", groups = {Update.class, Delete.class})
    private String permissionId;

    @NotBlank(message = "菜单名称不能为空", groups = {Create.class, Update.class})
    private String permissionName;

    @NotBlank(message = "业务路径不能为空", groups = {Create.class, Update.class})
    private String modelAction;

    @NotNull(message = "是否是菜单不能为空", groups = {Create.class, Update.class})
    private Boolean menuFlag;

    @NotNull(message = "是否有子节点不能为空", groups = {Create.class, Update.class})
    private Boolean haveChildFlag;

    @NotNull(message = "菜单父节点ID不能为空", groups = {Menu.class})
    private Integer parentLevelId;

    @NotNull(message = "pageIndex不能为空", groups = GetList.class)
    private Integer pageIndex;

    @NotNull(message = "pageSize不能为空", groups = GetList.class)
    private Integer pageSize;

    public interface Create extends Default {
    }

    public interface Update extends Default {
    }

    public interface Delete extends Default {
    }

    public interface Menu extends Default {
    }

    public interface Appoint extends Default {
    }

    public interface GetList extends Default {
    }
}
